package cn.xiaolang.function.ResourceBundleVSProperties;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;
import java.util.ResourceBundle;


public class ResourceBundleVSProperties {


  
	public static void main(String[] args) {
		/**
		 * resourceBundle加载配置文件
		 */
		ResourceBundle resourceBundle = ResourceBundle.getBundle("info");
		System.out.println(resourceBundle.getString("memberClassName"));
		/**
		 * properties加载配置文件
		 * 1.用inputStream流加载
		 * 2.用FileReader读取
		 * 注意：路径问题
		 */
		Properties properties = new Properties();
		try {
//			properties.load(ResourceBundleVSProperties.class.getResourceAsStream("/info.properties"));
			properties.load(new FileReader("conf/info.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		} 
		System.out.println(properties.get("memberClassName"));
		
	}
}
